<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/WEB-INF/jsp/common/include_easyui.jsp"></jsp:include>
<script type="text/javascript">

function saveData(){
	
	var isValid = jQuery("#addForm").form('validate');
	if(!isValid){
		jQuery("#addForm").form('enableValidation');
	}else{
		
		var saveURL = "<%=path%>/menuMgrController/addMenu?date="+new Date()+"";
		var paramObj = jQuery("#addForm").serializeArray();
		
		//alert(jQuery("#addForm").serialize())

		jQuery.post(saveURL,paramObj,function(responseData){
			var code = responseData.code;
			if (code == "200"){
				
				$.messager.confirm('提示对话框', '数据添加成功，是否继续添加?', function(flag){
					if (flag){
						location.href = "<%=path%>/menuMgrController/preAdd";
					}else{
						var parentWin = window.parent;
						parentWin.jQuery("#div_table").treegrid("reload");
						parentWin.jQuery('#dialog_div').dialog("close");
					}
				});

			}else{
				$.messager.alert('我的消息',"数据保存出错，原因 ：" + responseData.message,'error');
			}
			
		},"json");
	}
	
	
	
	
}
</script>

<style type="text/css">


.add-form div{
	margin-bottom:20px;
/* 	display: flex;
    justify-content:center; */
}
	

.add-form div input{
	max-width: 400px;
	height:28px;
	width:100%;
}

.add-form div select{
	max-width: 400px;
	height:28px;
	width:100%;
}
</style>
  </head>
  
  <body>
  
		<form id="addForm" method="post" class="add-form">
			<div style="padding-left:12%;margin-top:60px;width: 80%;">
				<input class="easyui-textbox" name="menuId" value="${menu.menuId}" labelAlign="right" data-options="label:'菜单ID：',required:true,readonly:true">
			</div>
			<div style="padding-left:12%;width: 80%;">
				<input class="easyui-textbox" name="grade" value="${menu.grade}" labelAlign="right" data-options="label:'菜单等级：',required:true,readonly:true">
			</div>
			<div style="padding-left:12%;width: 80%;">
				<input class="easyui-textbox" name="menuName" labelAlign="right" data-options="label:'菜单名称：',required:true">
			</div>
			<div style="padding-left:12%;width: 80%;">
				<input class="easyui-textbox" name="menuHref" labelAlign="right" data-options="label:'菜单链接：'">
			</div>
			<div style="padding-left:12%;width: 80%;">
				<select class="easyui-combobox" name="menuTarget" labelAlign="right" data-options="label:'菜单位置：',editable:false">
					<option value="">==请选择==</option>
					<option value="rightFrame">右边菜单栏</option>
					<option value="leftFrame">左边菜单栏</option>
					<option value="topFrame">顶部菜单栏</option>
					<option value="bottomFrame">底部菜单栏</option>
				</select>
			</div>
		</form>

  </body>
</html>
